package com.igrowing.easyRpc.config;

import com.igrowing.easyRpc.loadbalancer.LoadBalancerKeys;
import com.igrowing.easyRpc.protocol.ProtocolKeys;
import com.igrowing.easyRpc.retry.RetryStrategyKeys;
import com.igrowing.easyRpc.serializer.SerializerKeys;
import com.igrowing.easyRpc.tolerant.TolerantStrategyKeys;
import lombok.Data;

/**
 * RPC框架配置
 */
@Data
public class RpcConfig {

    /**
     * 名称
     */
    private String name = "igrowing";
    /**
     * 版本号
     */
    private String version = "1.0";
    /**
     * 服务主机
     */
    private String serverHost = "localhost";

    /**
     * 服务端口
     */
    private Integer serverPort = 8080;

    /**
     * 模拟调用
     */
    private boolean mock = false;

    /**
     * 序列化器
     */
    private String serializer = SerializerKeys.JDK;

    /**
     * 协议
     */
    private String protocol = ProtocolKeys.TCP_PROTOCOL;

    /**
     * 注册中心
     */
    private RegistryConfig registryConfig = new RegistryConfig();

    /**
     * 负载均衡器
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;

    /**
     * 重试策略
     */
    private String retryStrategy = RetryStrategyKeys.FIXED_INTERVAL;

    /**
     * 容错策略
     */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;

}
